package net.zjitc.api;

import java.io.IOException;

/**
 * @Author admin
 * @Date 2019/3/27 11:11
 */
public class RuntimeTest {
    public static void main(String[] args) {
        // 创建一个Runtime实例对象
        Runtime rt = Runtime.getRuntime();
// 得到表示进程的Process对象
        Process process = null;
        try {
            process = rt.exec("notepad.exe");
        } catch (IOException e) {
            e.printStackTrace();
        }
// 程序休眠3秒
        try {
            Thread.sleep(3000);
        } catch (Exception e) {
            e.printStackTrace();
        }
// 杀掉进程
        process.destroy();
    }
}
